package com.lcm.oj.lanqiao.year2020.real_two;

import java.util.Scanner;

/**
 * @author Coder-lcm
 * @date 2021/4/1
 */
public class T7_单词分析 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int[] chars = new int[27];
        String str = scanner.nextLine();
        char[] cs = str.toCharArray();
        for (char c : cs) {
            chars[c - 'a' + 1]++;
        }
        int max = chars[1];
        int index = 1;
        for (int i = 2; i < 27; i++) {
            if (chars[i] > max) {
                max = chars[i];
                index = i;
            }
        }
        System.out.println((char) (chars[index] + 'a' - 1));
        System.out.println(max);
    }
}
